package com.design.patterns.list.command.tv;

import com.design.patterns.list.command.Command;

/**
 * @author Wangzhiwen
 */
public class TvOnCommand implements Command {

    private TvReceiver tvReceiver;

    public TvOnCommand(TvReceiver tvReceiver) {
        this.tvReceiver = tvReceiver;
    }

    public void setTvReceiver(TvReceiver tvReceiver) {
        this.tvReceiver = tvReceiver;
    }

    @Override
    public Object commandIdentification() {
        return "Tv On Command";
    }

    @Override
    public void execute() {
        tvReceiver.on();
    }

    @Override
    public void undo() {
        tvReceiver.off();
    }
}
